const express = require('express');
const app = express();


//1.导入路由模块
const router = require('./router');
//2.注册路由模块
app.use('/api', router); //第一个参数就是统一的访问前缀，第二个参数是路由模块
/*app.use()就是用来注册全局中间件的*/

app.listen(8080, () => {
    console.log('server is running at localhost:8080');
});